home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10807 < prev    next >
Encoding:
Text File  |  1996-08-05  |  929 b   |  41 lines

  1. Newsgroups: comp.lang.c
  2. Path: bear.wn.bawue.de!jo
  3. From: jo@bear.wn.bawue.de (Joerg Sommrey)
  4. Subject: void ** question
  5. Message-ID: <DoJBrL.F5t@bear.wn.bawue.de>
  6. Organization: private
  7. Date: Tue, 19 Mar 1996 21:59:44 GMT
  8.  
  9. Hi all,
  10.  
  11. I have a question concerning conversion to `void **'. Given this piece
  12. of code:
  13.  
  14. void f(void **);
  15. int main(void)
  16. {
  17.    int **ppi;
  18.    f(ppi);
  19.    return 0;
  20. }
  21.  
  22. On four platforms I get three results: silence, warning and error when
  23. calling f().
  24.  
  25. The FAQ states there isn't a portable way of calling a function with a
  26. generic pointer by reference. This seems to be the point but I do not
  27. understand why.
  28.  
  29. My questions:
  30. 1) Is `(void **) ppi' legal (which makes any tested compiler shut up)?
  31. If it is legal:
  32. 2) Why doesn't this conversion take place silently when calling f()?
  33.  
  34. 3) Are any of these compilers broken?
  35.  
  36. Thanks!
  37.  
  38. -Jo
  39. -- 
  40. -rw-r--r--   1 jo       users          75 Mar 19 21:05 /home/jo/.signature
  41.